<template>
	<view class="facilityDetail-container">
		<view class="header">
			<view class="title">
				{{jobSubmitResultVo.job.subject}}
			</view>
			<view class="bottom">
				<view class="info">
					<view class="overhaulDate">
						<text class="iconfont icon-icon-test5" style="margin-right: 10rpx;"></text>
						{{jobSubmitResultVo.job.startTime}} 至 {{jobSubmitResultVo.job.endTime}}
					</view>
					<view class="useStatus used" v-if="jobSubmitResultVo.jobSubmit.status == 'a'">
						<text class="iconfont icon-icon-test5" style="margin-right: 10rpx;"></text>
						待审批
					</view>
					<view class="useStatus used" v-if="jobSubmitResultVo.jobSubmit.status == 'b'">
						<text class="iconfont icon-icon-test5" style="margin-right: 10rpx;"></text>
						已审批
					</view>
					<view class="useStatus notUsed" v-if="jobSubmitResultVo.jobSubmit.status == 'c'">
						<text class="iconfont icon-icon-test5" style="margin-right: 10rpx;"></text>
						未提交
					</view>
				</view>
				<view class="titleJob">
					作业
				</view>
				<view class="introduction">
					作业内容：{{jobSubmitResultVo.job.content}}
					<view style="display: flex; flex-wrap: wrap; justify-content: space-between;">
						<view v-for="(img,index) in jobSubmitResultVo.job.jobPhotos">
							<u-image :src="img.url" style="margin:  20rpx 0rpx;" width="200upx" height="200upx" mode=""
								@click="imgPreview(jobSubmitResultVo.job.jobPhotos)">
							</u-image>
						</view>
					</view>
				</view>
			</view>
			<view><br /></view>
			<view class="titleSubmitJob">
				评语
			</view>
			<view class="bottom">
				<view class="introduction">
					评语:{{jobSubmitResultVo.jobSubmit.evaluation}}
					<br/>
					评级:{{jobSubmitResultVo.jobSubmit.level}}
					<view style="display: flex; flex-wrap: wrap; justify-content: space-between;">
						<view v-for="(img,index) in jobSubmitResultVo.jobSubmit.jobSubmitPhotos">
							<u-image :src="img.url" style="margin:  20rpx 0rpx;" width="200upx" height="200upx" mode=""
								@click="imgPreview(jobSubmitResultVo.jobSubmit.jobSubmitPhotos)">
							</u-image>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id: '',
				jobSubmitResultVo: ""
			}
		},
		onLoad(opt) {
			// console.log(opt.id)
			this.id = opt.id
			this.getJobSubmit();
		},
		methods: {
			getJobSubmit() {
				this.$myReq({
						url: `/job/api/jobSubmit/detail/` + this.id,
						method: 'get'
					})
					.then((res) => {
						console.log(res.data)
						this.jobSubmitResultVo = res.data
					})
					.catch((err) => {
						console.log(err)
					})
			},
			imgPreview(imgs) {
				console.log("查看大图", imgs)
				let urls = [];
				for (let i = 0; i < imgs.length; i++) {
					urls.push(imgs[i].url);
				};
				uni.previewImage({
					indicator: "number",
					loop: true,
					urls: urls
				})
			}
		}
	}
</script>

<style lang="scss">
	.header {
		padding: 20rpx 40rpx 0rpx 40rpx;

		.title {
			font-size: 40rpx;
			font-weight: bold;
			margin-bottom: 20rpx;
		}

		.titleJob {
			font-size: 40rpx;
			font-weight: bold;
			margin-bottom: 20rpx;
			color: #e6ba90;
		}

		.titleSubmitJob {
			font-size: 40rpx;
			font-weight: bold;
			margin-bottom: 20rpx;
			color: #00aa00;
		}

		.bottom {
			.info {
				display: flex;
				flex-wrap: wrap;
				justify-content: space-between;
				margin-bottom: 30rpx;
				padding-bottom: 30rpx;
				border-bottom: 2px solid $main-garyA;

				.overhaulDate {
					// border: 1px solid;
					height: 60rpx;
					line-height: 60rpx;
				}

				.useStatus {
					border: 1px solid;
					height: 60rpx;
					width: 200rpx;
					line-height: 60rpx;
					text-align: center;
					// margin-right: 30rpx;
					color: white;
					font-size: 27rpx;
					border-radius: 30rpx;
				}

				.used {
					background-color: #09BE4F;
				}

				.notUsed {
					background-color: #09BE4F;
				}
			}

			.introduction {
				// border: 1px solid red;
				padding: 30rpx 25rpx 30rpx 25rpx;
				border-radius: 30rpx;
				background-color: $main-garyA;
				color: #000000;
				box-shadow: 0px 0px 3px 1px $main-garyB;
				font-size: 30rpx;
				line-height: 50rpx;
			}
		}
	}

	.content {
		padding: 30rpx 40rpx 0rpx 40rpx;

		.line {
			border-bottom: 2px solid $main-garyA;
			margin-bottom: 20rpx;
		}

		.timeItemRow {
			// border: 1px solid red;
			display: flex;
			flex-wrap: wrap;
			justify-content: space-around;
			height: 170rpx;
			margin-bottom: 50rpx;
			align-items: center;

			.timeItem {
				// border: 1px solid #cbcbcb;
				border-radius: 30rpx;
				width: 200rpx;
				height: 125rpx;
				align-items: center;
				padding-top: 45rpx;

				.time {
					// border: 1px solid blue;
					margin-bottom: 15rpx;
					text-align: center;
					font-size: 27rpx;
					font-weight: bold;
				}

				.orderState {
					// border: 1px solid blue;
					// font-weight: bold;
					text-align: center;
				}
			}
		}
	}

	.footer {
		padding: 0rpx 40rpx 0rpx 40rpx;
		position: fixed;
		bottom: 10rpx;
		// border: 1px solid red;
		width: 670rpx;
		display: flex;
		flex-wrap: wrap;
		justify-content: space-between;

		// height: 100rpx;
		.left {
			font-size: 30rpx;
			line-height: 50rpx;
			width: 360rpx;
			border-right: 2px solid #cecece;
			// border: 1px solid black;
		}

		.right {
			float: right;
			// border: 1px solid;
			height: 100rpx;
			width: 250rpx;
			text-align: center;
			line-height: 100rpx;
			color: white;
			background-color: #09BE4F;
			border-radius: 10rpx;
		}
	}

	.active {
		color: #FF2B2B;
		border: 1px solid #FF2B2B;
		// box-shadow: 0rpx 0rpx 1rpx 1rpx #FF2B2B;
	}

	.notActive {
		color: #000000;
		border: 1px solid #cbcbcb;
	}
</style>
